For a digital video encoder subsystem, such as an MPEG-2 or HDTV compliant digital video encoder subsystem, the occurrence of an error, such as switching the uncompressed video source from one device or channel to another while encoding, can pose many problems. The input video stream could be disturbed in such a manner as to present the encoder with one or more of the following problem scenarios:
1. Too few pixels per line for the current input line.
2. Too many pixels per line for the current input line.
3. Not enough lines for the current field/frame before the next field/frame arrives.
4. Too many lines for the current field/frame before the next field/frame arrives.
5. Odd-to-Even or Even-to-Odd field parity switch in the middle of a field.
6. Failure to switch field parity between fields.
Typical prior art encoding subsystems may respond to such disturbances by stopping the encoding process, that is, hanging, or by producing continually shifted luminance and/or chrominance output components, or by inverting the even and odd fields, or some other undesirable output. These responses all serve to carry the disturbance through subsequent pictures.
A more desirable response to such an input video disturbance would be to correct the error and resume normal encoding as soon as possible following the input video transition.
Thus, there exists a clear need for a method and apparatus to detect and correct errors in the synchronization signals of the input bitstream to the encoder, that is, the pixel bus, before the errors propagate through the system and become perceptible to the viewer.